package com.yj.suncity.bean;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

public class GoodsListBean {
	
	 private String success;//": "1",
	 private String totalpage;//": "1",
	 private String msg;//": "获取信息成功",
	 private List<GoodsShopBean> shopData;//": [
	 private List<GoodsBean> goodsData;//": [
	 
	public GoodsListBean(JSONObject json) {
		this.success = json.optString("success");
		this.totalpage = json.optString("totalpage");
		this.msg = json.optString("msg");
		this.shopData = new ArrayList<GoodsShopBean>();
		JSONArray array=json.optJSONArray("data");
		if (array!=null) {
			for (int i = 0; i < array.length(); i++) {
				JSONObject item = array.optJSONObject(i);
				if (item!=null) {
					this.shopData.add(new GoodsShopBean(item));
				}
			}
		}
		
		
		this.goodsData = new ArrayList<GoodsBean>();
		JSONArray array1=json.optJSONArray("data");
		if (array1!=null) {
			for (int i = 0; i < array1.length(); i++) {
				JSONObject item = array1.optJSONObject(i);
				if (item!=null) {
					this.goodsData.add(new GoodsBean(item));
				}
			}
		}
		
		
	}
	
	
	public List<GoodsBean> getGoodsData() {
		return goodsData;
	}


	public String getSuccess() {
		return success;
	}
	public String getTotalpage() {
		return totalpage;
	}
	public String getMsg() {
		return msg;
	}
	public List<GoodsShopBean> getShopData() {
		return shopData;
	}


}
